<%--
  Created by IntelliJ IDEA.
  User: 联想
  Date: 2024/11/6
  Time: 13:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="static/55.css" />
    <script type="text/javascript" src="./static/one.js"></script>
</head>
<body>
<div class="all">
    <div class="box">
        <h2>Login</h2>
        <div id="error" style="color:red">${error_which}</div>
        <form action="./Userservlet" method="post">
            <div class="input-box">
                <label>账户</label>
                <input type="text" name="username" id="username" placeholder="请输入账号" onblur="isUserName()"/>
                <div id="error_name" style="color:red"></div>
            </div>
            <div class="input-box">
                <label>密码</label>
                <input type="text" name="password" id="password" placeholder="请输入密码" onblur="isPassword()"/>
                <div id="error_password" style="color:red"></div>
            </div>
            <div class="input-box">
                <label>验证码:</label>
                <input type="text" name="image"><img src="VerifyCodeServlet">
                <input type="button" value="看不清? 换一张" id="btn">
                <font color="red">${requestScope.imageMess}</font>
            </div>
            <div>
                <input type="submit" value="登录" class="abc">
                <input type="reset" value="注册" class="abcd" onclick="k()">
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">

    document.getElementById("btn").onclick = function () {
        // 获取img元素
        // 为了让浏览器发送请求到servlet, 所以一定要改变src
        document.getElementsByTagName("img")[0].src = "VerifyCodeServlet?time=" + new Date().getTime();
    };
    function k() {
        location.href = "register.jsp"
    }
</script>
</body>
</html>
